<template>
    <div class="wc-homepage mint-header-pa">
        <mt-header fixed :title="dTitle">
            <mt-button slot="right" @click="_navToAdvice" class="feedback">反馈</mt-button>
        </mt-header>
        <vue-scroll :pullDownRefresh="false" :pullUpLoad="false">
            <info></info>
            <div class="hp-swipe">
                <mt-swipe :auto="4000" :show-indicators="false">
                    <mt-swipe-item>
                        <div class="mask"></div>
                        <div class="btns">
                            <span class="btn btn-1"></span>
                            <span class="btn btn-2"></span>
                            <span class="btn-text btn-text-1">我也要玩</span>
                            <span class="btn-text btn-text-2">邀请好友</span>
                        </div>
                        <div class="heads">
                            <p>发现真球友，让看球不再孤</p>
                            <p>NEVER WATCH ALONE</p>
                            <p>一次数据填写，结果持续更</p>
                        </div>
                    </mt-swipe-item>
                </mt-swipe>
            </div>
            <div class="hp-navbar">
                <div class="navbar-item" v-for="(item, index) in dNav" :key="index" @click="_navTo(item)">
                    <div :class="item.icon"></div>
                    <div class="text">{{item.title}}</div>
                </div>
            </div>
            <matchgame></matchgame>
            <!-- <vue-line :isMargin="true"></vue-line> -->
            <br>
        </vue-scroll>
    </div>
</template>
<script>
import moment from 'moment/moment'
import config from './config'
import info from './components/info'
import matchgame from './components/matchgame'
// import util from '@/common/util'
export default {
    components: {
        info,
        matchgame
    },
    data () {
        return {
            dTitle: this.variable.PROGRAM_NAME,
            dNav: config,
            dTime: moment([2018, 5, 14]).diff(moment(), 'days')
        }
    },
    methods: {
        _navToAdvice () {
            window.location = 'https://worldcup.dmpb.com.cn/advice/';
        },
        _navToGonglue () {
            window.location = 'https://worldcup.dmpb.com.cn/front/strategy1.html?id=26';
        },
        _navToPage (url) {
            this.$router.push({
                path: '/schedule'
            });
        },
        _navTo (item) {
            if (item.curPage) {
                // if (["oJEP8tyAV6dpCFA5BMrRQrxojdnE","oJEP8t7DsejMrxk2IEV9azDwBPMU","oJEP8t0l83UgUhxEYPQlpPsAEVU8","oJEP8t03z5DrCC5X9ochRlh7i2DY","oJEP8t4u9ff49GQnOCEX92WPZg1M","oJEP8t_rnBFzEfuA-fqwDKdWbytA","oJEP8t4EF7Mca7rggqG-y1BayE4I","oJEP8t-27tzRuk2idKyfDxZFEhbA","oJEP8t1M02M8J05yP1y9J7Qpg_WA","oJEP8t8pq5nBTShL_MnfVKDS35D8","oJEP8t1lqs28ugsUZkdTQJ8FK2bc",'oJEP8t3lOErHAb1nHabl21PIJkJU'].indexOf(window.app.openId) > -1) {
                //     this.$router.push('vote');
                // }else{
                //     util.alert('即将上线，敬请期待！');
                // }
                if (window.app.openId) {
                  this.$router.push('vote');
                }else{
                  window.location = "https://worldcup.dmpb.com.cn/";
                }
            }else {
                window.location = item.url + `?v=${new Date().getTime()}`;
            }
        }
    }
}
</script>
<style lang="less" scoped>
    @import './icons.less';
    @import '~assets/less/variable.less';
    .wc-homepage {
        width: 100%;
        height: 100%;
    }
    .hp-swipe {
        display: relative;
        height: 170px;
        .mask {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
            background-color: #030303;
            opacity: 0.6;
        }
        .btns {
            position: absolute;
            left: 13px;
            width: 200px;
            height: 30px;
            bottom: 24px;
        }
        .btn {
            display: inline-block;
            background-color: #fff;
            padding: 6px 18px;
            opacity: 0.6;
            color: transparent;
        }
        .btn-text {
            text-align: center;
            line-height: 30px;
            color: #fff;
            font-size: 14px;
        }
        .btn,
        .btn-text {
            box-sizing: border-box;
            width: 96px;
            height: 30px;
        }
        .btn-1,
        .btn-text-1 {
            position: absolute;
            top: 0;
            left: 0;
        }
        .btn-2,
        .btn-text-2 {
            position: absolute;
            top: 0;
            right: 0;
        }
        .heads {
            position: absolute;
            top: 25px;
            left: 13px;
            color: #fff;
            font-size: 16px;
        }
        p {
            line-height: 26px;
        }
        p:last-child {
            font-size: 13px;
        }
    }
    .hp-navbar {
        margin-top: 25px;
        padding: 0 6px;
        overflow: hidden;
        .navbar-item {
            margin-bottom: 14px;
            float: left;
            width: 25%;
            text-align: center;
            font-size: 12px;
        }
        .text {
            margin-top: 10px;
        }
    }
    .hp-countdown {
        text-align: center;
        width: 95%;
        margin: 10px auto 0;
        box-shadow: 1px 1px 10px #ccc;
        line-height: 2em;
        .date-time-span {
            padding: 0 5px;
            color: #f13426;
            font-size: 25px;
        }
    }
    .hp-detail {
        text-align: center;
        font-size: 14px;
        color: @color-tip-font;
    }
    .feedback {
        color: @color-add-blue;
    }
    .line {
        width: 100%;
        height: 1px;
        margin: 25px 0;
        background-color: @color-line-grey;
    }
</style>

